﻿using System.Collections.Generic;
using System.Linq;

namespace GrindZonesRandomizer
{
    public class Helpers
    {
        
        public static Zones MyZones = new Zones(); 

        #region Random Methods

        /// <summary>
        /// Return informations of the named Zone in the named List 
        /// </summary>
        public static void AddZone(int act, Enums.Difficulties diff, string zoneName)
        {
            Zone myZone = null;

            switch (diff)
            {
                case Enums.Difficulties.Normal:
                    if (act == 1)
                        myZone = A1NZones.First(z => z.ZoneName == zoneName);
                    if (act == 2)
                        myZone = A2NZones.First(z => z.ZoneName == zoneName);
                    if (act == 3)
                        myZone = A3NZones.First(z => z.ZoneName == zoneName);
                    break;
                case Enums.Difficulties.Cruel:
                    if (act == 1)
                        myZone = A1CZones.First(z => z.ZoneName == zoneName);
                    if (act == 2)
                        myZone = A2CZones.First(z => z.ZoneName == zoneName);
                    if (act == 3)
                        myZone = A3CZones.First(z => z.ZoneName == zoneName);
                    break;
                case Enums.Difficulties.Merciless:
                    if (act == 1)
                        myZone = A1MZones.First(z => z.ZoneName == zoneName);
                    if (act == 2)
                        myZone = A2MZones.First(z => z.ZoneName == zoneName);
                    if (act == 3)
                        myZone = A3MZones.First(z => z.ZoneName == zoneName);
                    break;
            }

            if(myZone != null)
            {
                MyZones.Add(myZone);
                GrindZonesRandomizer.MyLogger.Log(string.Format("Act {0} - {1} (Difficulty : {2}, Zone Level : {3})", act, myZone.ZoneName, myZone.ZoneDifficulty, myZone.ZoneLevel));   
            }
            else
            {
                GrindZonesRandomizer.MyLogger.Log("error", "There was an error adding the zone to the list, see below (default ZoneLevel is 0) :");
                GrindZonesRandomizer.MyLogger.Log("error", string.Format("Act {0} - {1} (Difficulty : {2}, Zone Level : {3})", act, zoneName, diff, 0));   
            }
        }

        #endregion

        #region ACT1

        // A1 Normal Zones
        public static List<Zone> A1NZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Normal, "The Twilight Strand", "1_1", 1),
           new Zone(Enums.Difficulties.Normal, "The Coast", "1_2", 2),  
           new Zone(Enums.Difficulties.Normal, "The Tidal Island", "1_2a", 3),
           new Zone(Enums.Difficulties.Normal, "The Mud Flats", "1_3", 4),
           new Zone(Enums.Difficulties.Normal, "The Fetid Pool", "1_3a", 5),
           new Zone(Enums.Difficulties.Normal, "The Lower Submerged Passage", "1_4_1", 5),
           new Zone(Enums.Difficulties.Normal, "The Upper Submerged Passage", "1_4_2", 6),
           new Zone(Enums.Difficulties.Normal, "The Flooded Depths", "1_4_0", 6),
           new Zone(Enums.Difficulties.Normal, "The Ledge", "1_5", 7),
           new Zone(Enums.Difficulties.Normal, "The Climb", "1_6", 8),
           new Zone(Enums.Difficulties.Normal, "The Lower Prison", "1_7_1", 9),
           new Zone(Enums.Difficulties.Normal, "The Upper Prison", "1_7_2", 10),
           new Zone(Enums.Difficulties.Normal, "Prisoner's Gate", "1_8", 11),
           new Zone(Enums.Difficulties.Normal, "The Ship Graveyard", "1_9", 12),
           new Zone(Enums.Difficulties.Normal, "The Coves", "1_10", 13),
           new Zone(Enums.Difficulties.Normal, "The Ship Graveyard Cave", "1_9a", 13),
           new Zone(Enums.Difficulties.Normal, "The Cavern of Wrath", "1_11_1", 14),
           new Zone(Enums.Difficulties.Normal, "The Cavern of Anger", "1_11_2", 15),
        };

        // A1 Cruel Zones
        public static List<Zone> A1CZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Cruel, "The Twilight Strand", "1_1", 35),
           new Zone(Enums.Difficulties.Cruel, "The Coast", "1_2", 35),  
           new Zone(Enums.Difficulties.Cruel, "The Tidal Island", "1_2a", 38),
           new Zone(Enums.Difficulties.Cruel, "The Mud Flats", "1_3", 36),
           new Zone(Enums.Difficulties.Cruel, "The Fetid Pool", "1_3a", 40),
           new Zone(Enums.Difficulties.Cruel, "The Lower Submerged Passage", "1_4_1", 36),
           new Zone(Enums.Difficulties.Cruel, "The Upper Submerged Passage", "1_4_2", 36),
           new Zone(Enums.Difficulties.Cruel, "The Flooded Depths", "1_4_0", 38),
           new Zone(Enums.Difficulties.Cruel, "The Ledge", "1_5", 37),
           new Zone(Enums.Difficulties.Cruel, "The Climb", "1_6", 37),
           new Zone(Enums.Difficulties.Cruel, "The Lower Prison", "1_7_1", 37),
           new Zone(Enums.Difficulties.Cruel, "The Upper Prison", "1_7_2", 38),
           new Zone(Enums.Difficulties.Cruel, "Prisoner's Gate", "1_8", 38),
           new Zone(Enums.Difficulties.Cruel, "The Ship Graveyard", "1_9", 38),
           new Zone(Enums.Difficulties.Cruel, "The Coves", "1_10", 39),
           new Zone(Enums.Difficulties.Cruel, "The Ship Graveyard Cave", "1_9a", 40),
           new Zone(Enums.Difficulties.Cruel, "The Cavern of Wrath", "1_11_1", 39),
           new Zone(Enums.Difficulties.Cruel, "The Cavern of Anger", "1_11_2", 40),
        };

        // A1 Merciless Zones
        public static List<Zone> A1MZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Merciless, "The Twilight Strand", "1_1", 52),
           new Zone(Enums.Difficulties.Merciless, "The Coast", "1_2", 52),  
           new Zone(Enums.Difficulties.Merciless, "The Tidal Island", "1_2a", 58),
           new Zone(Enums.Difficulties.Merciless, "The Mud Flats", "1_3", 52),
           new Zone(Enums.Difficulties.Merciless, "The Fetid Pool", "1_3a", 58),
           new Zone(Enums.Difficulties.Merciless, "The Lower Submerged Passage", "1_4_1", 53),
           new Zone(Enums.Difficulties.Merciless, "The Upper Submerged Passage", "1_4_2", 53),
           new Zone(Enums.Difficulties.Merciless, "The Flooded Depths", "1_4_0", 58),
           new Zone(Enums.Difficulties.Merciless, "The Ledge", "1_5", 53),
           new Zone(Enums.Difficulties.Merciless, "The Climb", "1_6", 54),
           new Zone(Enums.Difficulties.Merciless, "The Lower Prison", "1_7_1", 54),
           new Zone(Enums.Difficulties.Merciless, "The Upper Prison", "1_7_2", 54),
           new Zone(Enums.Difficulties.Merciless, "Prisoner's Gate", "1_8", 55),
           new Zone(Enums.Difficulties.Merciless, "The Ship Graveyard", "1_9", 55),
           new Zone(Enums.Difficulties.Merciless, "The Coves", "1_10", 55),
           new Zone(Enums.Difficulties.Merciless, "The Ship Graveyard Cave", "1_9a", 59),
           new Zone(Enums.Difficulties.Merciless, "The Cavern of Wrath", "1_11_1", 55),
           new Zone(Enums.Difficulties.Merciless, "The Cavern of Anger", "1_11_2", 56),
        };

        #endregion

        #region ACT2

        // Normal
        public static List<Zone> A2NZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Normal, "The Southern Forest", "2_1", 15),
           new Zone(Enums.Difficulties.Normal, "The Old Fields", "2_2", 16),  
           new Zone(Enums.Difficulties.Normal, "The Riverways", "2_7", 16),
           new Zone(Enums.Difficulties.Normal, "The Crossroads", "2_3", 17),
           new Zone(Enums.Difficulties.Normal, "The Den", "2_2a", 17),
           new Zone(Enums.Difficulties.Normal, "The Blackwood", "2_8", 18),
           new Zone(Enums.Difficulties.Normal, "The Fellshrine Ruins", "2_15", 18),
           new Zone(Enums.Difficulties.Normal, "The Chamber of Sins Level 1", "2_6_1", 19),
           new Zone(Enums.Difficulties.Normal, "The Chamber of Sins Level 2", "2_6_2", 20),
           new Zone(Enums.Difficulties.Normal, "The Weaver's Chambers", "2_10", 20),
           new Zone(Enums.Difficulties.Normal, "The Crypt Level 1", "2_5_1", 21),
           new Zone(Enums.Difficulties.Normal, "The Broken Bridge", "2_4", 21),
           new Zone(Enums.Difficulties.Normal, "The Western Forest", "2_9", 21),
           new Zone(Enums.Difficulties.Normal, "The Vaal Ruins Level 1", "2_11_1", 21),
           new Zone(Enums.Difficulties.Normal, "The Chamber of Sins Level 3", "2_6_3", 21),
           new Zone(Enums.Difficulties.Normal, "The Crypt Level 2", "2_5_2", 22),
           new Zone(Enums.Difficulties.Normal, "The Vaal Ruins Level 2", "2_11_2", 22),
           new Zone(Enums.Difficulties.Normal, "The Wetlands", "2_12", 23),
           new Zone(Enums.Difficulties.Normal, "The Caverns Level 1", "2_14_1", 24),
           new Zone(Enums.Difficulties.Normal, "The Dread Thicket", "2_13", 24),
           new Zone(Enums.Difficulties.Normal, "The Caverns Level 2", "2_14_2", 25),
           new Zone(Enums.Difficulties.Normal, "Ancient Pyramid", "2_14_3", 26),
        };

        // Cruel
        public static List<Zone> A2CZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Cruel, "The Southern Forest", "2_1", 40),
           new Zone(Enums.Difficulties.Cruel, "The Old Fields", "2_2", 41),  
           new Zone(Enums.Difficulties.Cruel, "The Riverways", "2_7", 41),
           new Zone(Enums.Difficulties.Cruel, "The Crossroads", "2_3", 41),
           new Zone(Enums.Difficulties.Cruel, "The Den", "2_2a", 43),
           new Zone(Enums.Difficulties.Cruel, "The Blackwood", "2_8", 42),
           new Zone(Enums.Difficulties.Cruel, "The Fellshrine Ruins", "2_15", 43),
           new Zone(Enums.Difficulties.Cruel, "The Chamber of Sins Level 1", "2_6_1", 42),
           new Zone(Enums.Difficulties.Cruel, "The Chamber of Sins Level 2", "2_6_2", 42),
           new Zone(Enums.Difficulties.Cruel, "The Weaver's Chambers", "2_10", 42),
           new Zone(Enums.Difficulties.Cruel, "The Crypt Level 1", "2_5_1", 43),
           new Zone(Enums.Difficulties.Cruel, "The Broken Bridge", "2_4", 43),
           new Zone(Enums.Difficulties.Cruel, "The Western Forest", "2_9", 43),
           new Zone(Enums.Difficulties.Cruel, "The Vaal Ruins Level 1", "2_11_1", 44),
           new Zone(Enums.Difficulties.Cruel, "The Chamber of Sins Level 3", "2_6_3", 43),
           new Zone(Enums.Difficulties.Cruel, "The Crypt Level 2", "2_5_2", 43),
           new Zone(Enums.Difficulties.Cruel, "The Vaal Ruins Level 2", "2_11_2", 44),
           new Zone(Enums.Difficulties.Cruel, "The Wetlands", "2_12", 45),
           new Zone(Enums.Difficulties.Cruel, "The Caverns Level 1", "2_14_1", 45),
           new Zone(Enums.Difficulties.Cruel, "The Dread Thicket", "2_13", 47),
           new Zone(Enums.Difficulties.Cruel, "The Caverns Level 2", "2_14_2", 45),
           new Zone(Enums.Difficulties.Cruel, "Ancient Pyramid", "2_14_3", 46),
        };

        // Merciless
        public static List<Zone> A2MZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Merciless, "The Southern Forest", "2_1", 57),
           new Zone(Enums.Difficulties.Merciless, "The Old Fields", "2_2", 57),  
           new Zone(Enums.Difficulties.Merciless, "The Riverways", "2_7", 57),
           new Zone(Enums.Difficulties.Merciless, "The Crossroads", "2_3", 57),
           new Zone(Enums.Difficulties.Merciless, "The Den", "2_2a", 61),
           new Zone(Enums.Difficulties.Merciless, "The Blackwood", "2_8", 57),
           new Zone(Enums.Difficulties.Merciless, "The Fellshrine Ruins", "2_15", 59),
           new Zone(Enums.Difficulties.Merciless, "The Chamber of Sins Level 1", "2_6_1", 58),
           new Zone(Enums.Difficulties.Merciless, "The Chamber of Sins Level 2", "2_6_2", 58),
           new Zone(Enums.Difficulties.Merciless, "The Weaver's Chambers", "2_10", 58),
           new Zone(Enums.Difficulties.Merciless, "The Crypt Level 1", "2_5_1", 60),
           new Zone(Enums.Difficulties.Merciless, "The Broken Bridge", "2_4", 58),
           new Zone(Enums.Difficulties.Merciless, "The Western Forest", "2_9", 58),
           new Zone(Enums.Difficulties.Merciless, "The Vaal Ruins Level 1", "2_11_1", 58),
           new Zone(Enums.Difficulties.Merciless, "The Chamber of Sins Level 3", "2_6_3", 59),
           new Zone(Enums.Difficulties.Merciless, "The Crypt Level 2", "2_5_2", 60),
           new Zone(Enums.Difficulties.Merciless, "The Vaal Ruins Level 2", "2_11_2", 58),
           new Zone(Enums.Difficulties.Merciless, "The Wetlands", "2_12", 59),
           new Zone(Enums.Difficulties.Merciless, "The Caverns Level 1", "2_14_1", 60),
           new Zone(Enums.Difficulties.Merciless, "The Dread Thicket", "2_13", 62),
           new Zone(Enums.Difficulties.Merciless, "The Caverns Level 2", "2_14_2", 60),
           new Zone(Enums.Difficulties.Merciless, "Ancient Pyramid", "2_14_3", 60),
        };

        #endregion

        #region ACT3

        // Normal
        public static List<Zone> A3NZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Normal, "The City of Sarn", "3_1", 26),
           new Zone(Enums.Difficulties.Normal, "The Slums", "3_2", 27),  
           new Zone(Enums.Difficulties.Normal, "The Crematorium", "3_3_1", 28),
           new Zone(Enums.Difficulties.Normal, "The Slums Sewers", "3_10_0", 28),
           new Zone(Enums.Difficulties.Normal, "The Marketplace", "3_5", 29),
           new Zone(Enums.Difficulties.Normal, "The Warehouse Sewers", "3_10_1", 29),
           new Zone(Enums.Difficulties.Normal, "The Warehouse District", "3_4", 29),
           new Zone(Enums.Difficulties.Normal, "The Market Sewers", "3_10_2", 30),
           new Zone(Enums.Difficulties.Normal, "The Battlefront", "3_7", 30),
           new Zone(Enums.Difficulties.Normal, "The Solaris Temple Level 1", "3_8_1", 30),
           new Zone(Enums.Difficulties.Normal, "The Catacombs", "3_6_1", 30),
           new Zone(Enums.Difficulties.Normal, "The Solaris Temple Level 2", "3_8_2", 31),
           new Zone(Enums.Difficulties.Normal, "The Docks", "3_9", 32),
           new Zone(Enums.Difficulties.Normal, "The Sewer Waterway", "3_10_3", 32),
           new Zone(Enums.Difficulties.Normal, "The Ebony Barracks", "3_13", 32),
           new Zone(Enums.Difficulties.Normal, "The Lunaris Temple Level 1", "3_14_1", 32),
           new Zone(Enums.Difficulties.Normal, "The Lunaris Temple Level 2", "3_14_2", 33),
           new Zone(Enums.Difficulties.Normal, "The Lunaris Temple Level 3", "3_14_3", 33),
           new Zone(Enums.Difficulties.Normal, "The Imperial Garden", "3_15", 34),
           new Zone(Enums.Difficulties.Normal, "The Library", "3_17_1", 33),
           new Zone(Enums.Difficulties.Normal, "The Archives", "3_17_2", 34),
           new Zone(Enums.Difficulties.Normal, "The Hedge Maze", "3_16", 34),
           new Zone(Enums.Difficulties.Normal, "The Sceptre of God", "3_18_1", 35),
           new Zone(Enums.Difficulties.Normal, "The Upper Sceptre of God", "3_18_12", 36),
        };

        // Cruel
        public static List<Zone> A3CZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Cruel, "The City of Sarn", "3_1", 46),
           new Zone(Enums.Difficulties.Cruel, "The Slums", "3_2", 46),  
           new Zone(Enums.Difficulties.Cruel, "The Crematorium", "3_3_1", 47),
           new Zone(Enums.Difficulties.Cruel, "The Slums Sewers", "3_10_0", 46),
           new Zone(Enums.Difficulties.Cruel, "The Marketplace", "3_5", 48),
           new Zone(Enums.Difficulties.Cruel, "The Warehouse Sewers", "3_10_1", 48),
           new Zone(Enums.Difficulties.Cruel, "The Warehouse District", "3_4", 47),
           new Zone(Enums.Difficulties.Cruel, "The Market Sewers", "3_10_2", 49),
           new Zone(Enums.Difficulties.Cruel, "The Battlefront", "3_7", 49),
           new Zone(Enums.Difficulties.Cruel, "The Solaris Temple Level 1", "3_8_1", 49),
           new Zone(Enums.Difficulties.Cruel, "The Catacombs", "3_6_1", 53),
           new Zone(Enums.Difficulties.Cruel, "The Solaris Temple Level 2", "3_8_2", 50),
           new Zone(Enums.Difficulties.Cruel, "The Docks", "3_9", 50),
           new Zone(Enums.Difficulties.Cruel, "The Sewer Waterway", "3_10_3", 50),
           new Zone(Enums.Difficulties.Cruel, "The Ebony Barracks", "3_13", 51),
           new Zone(Enums.Difficulties.Cruel, "The Lunaris Temple Level 1", "3_14_1", 51),
           new Zone(Enums.Difficulties.Cruel, "The Lunaris Temple Level 2", "3_14_2", 51),
           new Zone(Enums.Difficulties.Cruel, "The Lunaris Temple Level 3", "3_14_3", 52),
           new Zone(Enums.Difficulties.Cruel, "The Imperial Garden", "3_15", 51),
           new Zone(Enums.Difficulties.Cruel, "The Library", "3_17_1", 51),
           new Zone(Enums.Difficulties.Cruel, "The Archives", "3_17_2", 52),
           new Zone(Enums.Difficulties.Cruel, "The Hedge Maze", "3_16", 52),
           new Zone(Enums.Difficulties.Cruel, "The Sceptre of God", "3_18_1", 53),
           new Zone(Enums.Difficulties.Cruel, "The Upper Sceptre of God", "3_18_12", 54),
        };

        // Merciless
        public static List<Zone> A3MZones = new List<Zone>
        { 
           new Zone(Enums.Difficulties.Merciless, "The City of Sarn", "3_1", 61),
           new Zone(Enums.Difficulties.Merciless, "The Slums", "3_2", 61),  
           new Zone(Enums.Difficulties.Merciless, "The Crematorium", "3_3_1", 61),
           new Zone(Enums.Difficulties.Merciless, "The Slums Sewers", "3_10_0", 61),
           new Zone(Enums.Difficulties.Merciless, "The Marketplace", "3_5", 61),
           new Zone(Enums.Difficulties.Merciless, "The Warehouse Sewers", "3_10_1", 61),
           new Zone(Enums.Difficulties.Merciless, "The Warehouse District", "3_4", 61),
           new Zone(Enums.Difficulties.Merciless, "The Market Sewers", "3_10_2", 63),
           new Zone(Enums.Difficulties.Merciless, "The Battlefront", "3_7", 62),
           new Zone(Enums.Difficulties.Merciless, "The Solaris Temple Level 1", "3_8_1", 62),
           new Zone(Enums.Difficulties.Merciless, "The Catacombs", "3_6_1", 67),
           new Zone(Enums.Difficulties.Merciless, "The Solaris Temple Level 2", "3_8_2", 62),
           new Zone(Enums.Difficulties.Merciless, "The Docks", "3_9", 62),
           new Zone(Enums.Difficulties.Merciless, "The Sewer Waterway", "3_10_3", 63),
           new Zone(Enums.Difficulties.Merciless, "The Ebony Barracks", "3_13", 63),
           new Zone(Enums.Difficulties.Merciless, "The Lunaris Temple Level 1", "3_14_1", 65),
           new Zone(Enums.Difficulties.Merciless, "The Lunaris Temple Level 2", "3_14_2", 65),
           new Zone(Enums.Difficulties.Merciless, "The Lunaris Temple Level 3", "3_14_3", 66),
           new Zone(Enums.Difficulties.Merciless, "The Imperial Garden", "3_15", 66),
           new Zone(Enums.Difficulties.Merciless, "The Library", "3_17_1", 67),
           new Zone(Enums.Difficulties.Merciless, "The Archives", "3_17_2", 67),
           new Zone(Enums.Difficulties.Merciless, "The Hedge Maze", "3_16", 67),
           new Zone(Enums.Difficulties.Merciless, "The Sceptre of God", "3_18_1", 67),
           new Zone(Enums.Difficulties.Merciless, "The Upper Sceptre of God", "3_18_12", 68),
        };

        #endregion
    }
}
